<html>
<head><meta charset="utf-8"><title>rustc on wasm · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20on.20wasm.html">rustc on wasm</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="205523928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20on%20wasm/near/205523928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20on.20wasm.html#205523928">(Jul 30 2020 at 19:47)</a>:</h4>
<p>I just got rustc + cg_clif compiling and running on wasm with wasi. Everything except for running the linker seems to work. I also manually called the linker for a hello world compiled for x86_64 and it worked fine.</p>



<a name="205524084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20on%20wasm/near/205524084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20on.20wasm.html#205524084">(Jul 30 2020 at 19:49)</a>:</h4>
<p>It takes about 10 seconds before wasmtime starts executing it when the cache is warm. It doesn't run much slower than native once wasmtime has loaded it I think.</p>



<a name="205673235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20on%20wasm/near/205673235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20on.20wasm.html#205673235">(Aug 01 2020 at 09:19)</a>:</h4>
<p><a href="/user_uploads/4715/f3pc8VZNyqIlaRNkeiGp2yCu/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/f3pc8VZNyqIlaRNkeiGp2yCu/image.png" title="image.png"><img src="/user_uploads/4715/f3pc8VZNyqIlaRNkeiGp2yCu/image.png"></a></div><p>Rustc running in the browser using an incomplete wasi polyfill. It doesn't yet support loading crates from the sysroot, but it can report syntax errors, as those only depend on a single file.</p>



<a name="205678487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20on%20wasm/near/205678487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20on.20wasm.html#205678487">(Aug 01 2020 at 12:03)</a>:</h4>
<p>that's amazing!</p>



<a name="205681572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20on%20wasm/near/205681572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Teymour Aldridge <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20on.20wasm.html#205681572">(Aug 01 2020 at 13:32)</a>:</h4>
<p>Wow!</p>



<a name="205686745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20on%20wasm/near/205686745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20on.20wasm.html#205686745">(Aug 01 2020 at 15:51)</a>:</h4>
<p><a href="/user_uploads/4715/CRM6eo_7SPPQdaEz0QGCssWA/image.png">image.png</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/CRM6eo_7SPPQdaEz0QGCssWA/image.png" title="image.png"><img src="/user_uploads/4715/CRM6eo_7SPPQdaEz0QGCssWA/image.png"></a></div><p>Loading sysroot works. Next up: writing the output file.</p>



<a name="205695027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20on%20wasm/near/205695027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20on.20wasm.html#205695027">(Aug 01 2020 at 19:31)</a>:</h4>
<p><a href="/user_uploads/4715/YJfUrYf8EmGpsdRYqw1bhfMv/image.png">image.png</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/YJfUrYf8EmGpsdRYqw1bhfMv/image.png" title="image.png"><img src="/user_uploads/4715/YJfUrYf8EmGpsdRYqw1bhfMv/image.png"></a></div><p><a href="/user_uploads/4715/TdhVGo4t_lv9LXqFt3AjV1ZY/image.png">image.png</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/TdhVGo4t_lv9LXqFt3AjV1ZY/image.png" title="image.png"><img src="/user_uploads/4715/TdhVGo4t_lv9LXqFt3AjV1ZY/image.png"></a></div><p>Compiled an object file in the browser.</p>



<a name="205695075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20on%20wasm/near/205695075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20on.20wasm.html#205695075">(Aug 01 2020 at 19:33)</a>:</h4>
<p><a href="https://github.com/bjorn3/rust/tree/compile_rustc_wasm4">https://github.com/bjorn3/rust/tree/compile_rustc_wasm4</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>